package com.gitee.zhanyao.cloud.security.entity.system;

import com.gitee.zhanyao.cloud.security.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户帐号
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "sys_user_account")
public class SysUserAccount extends BaseEntity implements Serializable {

    /**
     * 帐号主键
     */
    @Id
    @GeneratedValue(generator = "uuidStrategy")
    @GenericGenerator(name = "uuidStrategy", strategy = "uuid")
    private String id;
    /**
     * 登录帐号
     */
    private String loginName;
    /**
     * 帐号类型
     */
    private Integer accountType;
    /**
     * 用户
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private SysUser sysUser;

}
